package com.nbsaas.boot.order.api.domain.response;

import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 订单查询响应对象
 * 使用Freemarker动态生成
 */
@Data
public class OrderQueryResponse {

    /**
     * 订单ID
     */
    private Long id;

    /**
     * 订单编号
     */
    private String billNo;

    /**
     * 添加时间
     */
    private LocalDateTime addDate;

    /**
     * 最新修改时间
     */
    private LocalDateTime lastDate;

    /**
     * 客户ID
     */
    private Long customerId;

    /**
     * 客户名称
     */
    private String customerName;

    /**
     * 客户手机号
     */
    private String customerPhone;

    /**
     * 总金额
     */
    private BigDecimal totalAmount;

    /**
     * 订单金额
     */
    private BigDecimal amount;

    /**
     * 折扣率
     */
    private BigDecimal discountRate;

    /**
     * 折扣金额
     */
    private BigDecimal discount;

    /**
     * 支付金额
     */
    private BigDecimal payAmount;

    /**
     * 余额付款金额
     */
    private BigDecimal balance;

    /**
     * 车马费付款金额
     */
    private BigDecimal travelBalance;

    /**
     * 会员卡ID
     */
    private Long vipCardId;

    /**
     * 优惠券金额
     */
    private BigDecimal couponMoney;

    /**
     * 在线支付金额
     */
    private BigDecimal onlinePay;

    /**
     * 支付方式
     */
    private Integer payMethod;

    /**
     * 支付方式名称
     */
    private String payMethodName;

    /**
     * 支付状态
     */
    private Integer payState;

    /**
     * 支付状态名称
     */
    private String payStateName;

    /**
     * 会员会期ID
     */
    private Long sessionId;

    /**
     * 订单类型
     */
    private Integer orderType;

    /**
     * 订单类型名称
     */
    private String orderTypeName;

    /**
     * 变更金额
     */
    private BigDecimal changeAmount;

    /**
     * 修改价格时间
     */
    private LocalDateTime editPriceTime;

    /**
     * 完成时间
     */
    private LocalDateTime finishTime;

    /**
     * 运费
     */
    private BigDecimal freight;

    /**
     * 是否延长收货
     */
    private Boolean hasExtendReceive;

    /**
     * 积分折扣
     */
    private BigDecimal integralDiscount;

    /**
     * 餐费
     */
    private BigDecimal mealFee;

    /**
     * 数量
     */
    private Integer num;

    /**
     * 订单来源
     */
    private Integer orderSource;

    /**
     * 订单来源名称
     */
    private String orderSourceName;

    /**
     * 平台折扣
     */
    private BigDecimal platformDiscount;

    /**
     * 商品数量
     */
    private Integer productCount;

    /**
     * 红包折扣
     */
    private BigDecimal redPacketDiscount;

    /**
     * 减免金额
     */
    private BigDecimal reduceMoney;

    /**
     * 提醒时间
     */
    private LocalDateTime remindTime;

    /**
     * 退款金额
     */
    private BigDecimal returnAmount;

    /**
     * 退款数量
     */
    private Integer returnCount;

    /**
     * 赠送积分
     */
    private BigDecimal sendIntegral;

    /**
     * 店铺状态
     */
    private Integer storeState;

    /**
     * 店铺状态名称
     */
    private String storeStateName;

    /**
     * 系统收货时间
     */
    private LocalDateTime sysReceiveTime;

    /**
     * 使用积分
     */
    private BigDecimal useIntegral;

    /**
     * 使用红包
     */
    private BigDecimal useRedPacket;

    /**
     * 重量
     */
    private BigDecimal weight;

    /**
     * 订单处理类
     */
    private String orderHandle;

    /**
     * 订单状态
     */
    private Integer orderState;

    /**
     * 订单状态名称
     */
    private String orderStateName;

    /**
     * 订单名称
     */
    private String name;

    /**
     * 店铺ID
     */
    private Long shopId;

    /**
     * 店铺名称
     */
    private String shopName;

    /**
     * 红包ID
     */
    private Long redPacketId;

    /**
     * 门店ID
     */
    private Long storeId;

    /**
     * 门店名称
     */
    private String storeName;

    /**
     * 会员支付
     */
    private Integer vipPay;

    /**
     * 年
     */
    private Integer year;

    /**
     * 月
     */
    private Integer month;

    /**
     * 季度
     */
    private Integer quarter;

    /**
     * 周
     */
    private Integer week;

    /**
     * 天（按年）
     */
    private Integer day;

    /**
     * 天（按月）
     */
    private Integer dayOfMonth;

    /**
     * 天（按周）
     */
    private Integer dayOfWeek;

    /**
     * 店铺优惠券ID
     */
    private Long shopCouponId;

    /**
     * 备注
     */
    private String note;

    /**
     * 赠送金额
     */
    private BigDecimal giveMoney;

    /**
     * 门票使用张数
     */
    private Integer ticketNum;

    /**
     * 充值金额
     */
    private BigDecimal rechargeMoney;

    /**
     * 福利ID
     */
    private Long welfareId;

    /**
     * 福利金额
     */
    private BigDecimal welfareMoney;

    /**
     * 微信openId
     */
    private String openId;

    /**
     * 支付单号
     */
    private String payNo;

    /**
     * 邀请人ID
     */
    private Long inviterId;

    /**
     * 邀请店铺ID
     */
    private Long inviterShop;

    /**
     * 抵扣数量
     */
    private Integer discountNum;

    /**
     * 推广卡ID
     */
    private Long promotionCard;

    /**
     * 订单项列表
     */
    private List<OrderItemResponse> orderItems;

    /**
     * 订单地址信息
     */
    private OrderAddressResponse orderAddress;

    /**
     * 订单支付信息
     */
    private OrderPaymentResponse orderPayment;

    /**
     * 订单物流信息
     */
    private OrderLogisticsResponse orderLogistics;

    /**
     * 订单日志列表
     */
    private List<OrderLogResponse> orderLogs;

    /**
     * 订单优惠券信息
     */
    private OrderCouponResponse orderCoupon;

    /**
     * 订单退款信息
     */
    private OrderRefundResponse orderRefund;

    /**
     * 订单评价信息
     */
    private OrderReviewResponse orderReview;

    /**
     * 订单发票信息
     */
    private OrderInvoiceResponse orderInvoice;

    /**
     * 统计信息
     */
    private Map<String, Object> statistics;

    /**
     * 扩展信息
     */
    private Map<String, Object> extInfo;

    /**
     * 创建人ID
     */
    private Long createBy;

    /**
     * 创建人姓名
     */
    private String createByName;

    /**
     * 创建时间
     */
    private LocalDateTime createDate;

    /**
     * 更新人ID
     */
    private Long updateBy;

    /**
     * 更新人姓名
     */
    private String updateByName;

    /**
     * 更新时间
     */
    private LocalDateTime updateDate;

    /**
     * 删除标记
     */
    private Boolean deleted;

    /**
     * 版本号
     */
    private Long version;

    /**
     * 租户ID
     */
    private Long tenantId;

    /**
     * 应用ID
     */
    private Long appId;

    /**
     * 模块ID
     */
    private Long moduleId;

    /**
     * 功能ID
     */
    private Long functionId;

    /**
     * 数据权限范围
     */
    private String dataScope;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 部门ID
     */
    private Long deptId;

    /**
     * 角色ID
     */
    private Long roleId;

    /**
     * 操作类型
     */
    private String operationType;

    /**
     * 操作人ID
     */
    private Long operatorId;

    /**
     * 操作时间
     */
    private LocalDateTime operationTime;

    /**
     * 操作IP
     */
    private String operationIp;

    /**
     * 操作设备
     */
    private String operationDevice;

    /**
     * 操作浏览器
     */
    private String operationBrowser;

    /**
     * 操作系统
     */
    private String operationOs;

    /**
     * 操作位置
     */
    private String operationLocation;

    /**
     * 操作结果
     */
    private String operationResult;

    /**
     * 操作描述
     */
    private String operationDescription;

    /**
     * 扩展字段1
     */
    private String extField1;

    /**
     * 扩展字段2
     */
    private String extField2;

    /**
     * 扩展字段3
     */
    private String extField3;

    /**
     * 扩展字段4
     */
    private String extField4;

    /**
     * 扩展字段5
     */
    private String extField5;

    /**
     * 扩展字段6
     */
    private String extField6;

    /**
     * 扩展字段7
     */
    private String extField7;

    /**
     * 扩展字段8
     */
    private String extField8;

    /**
     * 扩展字段9
     */
    private String extField9;

    /**
     * 扩展字段10
     */
    private String extField10;
}

/**
 * 订单项响应对象
 */
@Data
class OrderItemResponse {
    private Long id;
    private Long orderId;
    private Long productId;
    private String productName;
    private String productImage;
    private BigDecimal price;
    private Integer quantity;
    private BigDecimal totalAmount;
    private String specifications;
    private String remark;
}

/**
 * 订单地址响应对象
 */
@Data
class OrderAddressResponse {
    private Long id;
    private Long orderId;
    private String receiverName;
    private String receiverPhone;
    private String province;
    private String city;
    private String district;
    private String address;
    private String zipCode;
    private String remark;
}

/**
 * 订单支付响应对象
 */
@Data
class OrderPaymentResponse {
    private Long id;
    private Long orderId;
    private Integer payMethod;
    private String payMethodName;
    private Integer payState;
    private String payStateName;
    private BigDecimal payAmount;
    private String payNo;
    private LocalDateTime payTime;
    private String transactionId;
    private String remark;
}

/**
 * 订单物流响应对象
 */
@Data
class OrderLogisticsResponse {
    private Long id;
    private Long orderId;
    private String logisticsCompany;
    private String logisticsNo;
    private Integer deliveryStatus;
    private String deliveryStatusName;
    private LocalDateTime deliveryTime;
    private String receiverName;
    private String receiverPhone;
    private String deliveryAddress;
    private String remark;
}

/**
 * 订单日志响应对象
 */
@Data
class OrderLogResponse {
    private Long id;
    private Long orderId;
    private String operationType;
    private String operationDescription;
    private Long operatorId;
    private String operatorName;
    private LocalDateTime operationTime;
    private String operationIp;
    private String remark;
}

/**
 * 订单优惠券响应对象
 */
@Data
class OrderCouponResponse {
    private Long id;
    private Long orderId;
    private Long couponId;
    private String couponName;
    private BigDecimal couponAmount;
    private String couponCode;
    private LocalDateTime useTime;
    private String remark;
}

/**
 * 订单退款响应对象
 */
@Data
class OrderRefundResponse {
    private Long id;
    private Long orderId;
    private Integer refundType;
    private String refundTypeName;
    private BigDecimal refundAmount;
    private Integer refundStatus;
    private String refundStatusName;
    private String refundReason;
    private LocalDateTime refundTime;
    private String refundNo;
    private String remark;
}

/**
 * 订单评价响应对象
 */
@Data
class OrderReviewResponse {
    private Long id;
    private Long orderId;
    private Integer rating;
    private String content;
    private String images;
    private Boolean anonymous;
    private LocalDateTime reviewTime;
    private String reply;
    private LocalDateTime replyTime;
    private String remark;
}

/**
 * 订单发票响应对象
 */
@Data
class OrderInvoiceResponse {
    private Long id;
    private Long orderId;
    private Integer invoiceType;
    private String invoiceTypeName;
    private String invoiceTitle;
    private String invoiceContent;
    private String taxNumber;
    private String invoiceAddress;
    private String invoicePhone;
    private String invoiceBank;
    private String invoiceAccount;
    private String remark;
} 